import { getItem, setItem } from '@/utils/storage'
const selectByParentCode = {
  namespaced:true,
  state: {
    dealerCodeData: getItem('dealerCodeData'),
    waterGrapCodeData: getItem('waterGrapCodeData')
  },
  mutations: {
    // 建立经销商code---
    setDealerCodeData(state, data){       
        // 实现共享
        state.dealerCodeData = data
        // 实现数据持久化
        setItem('dealerCodeData',state.dealerCodeData)
    },
    // 建立水司code---
    setWaterGrapCodeData(state, data){
        // 实现共享
        state.waterGrapCodeData = data
        // 实现数据持久化
        setItem('waterGrapCodeData',state.waterGrapCodeData)
    }
  },
  actions: {
  },
  modules: {
  }
  
}

export default selectByParentCode;
